package com.llj.Road_curve_measuring_system.module.feature;


import android.view.View;

import com.llj.Road_curve_measuring_system.base.BaseActivity;
import com.llj.Road_curve_measuring_system.common.GlobalConstant;
import com.llj.Road_curve_measuring_system.databinding.ActivityFeatureBinding;
import com.llj.Road_curve_measuring_system.module.input.InputActivity;
import com.llj.Road_curve_measuring_system.util.ActivityUtil;

/**
 *第二个页面的Activity
 */
public class FeatureActivity extends BaseActivity<FeaturePresenter> implements FeatureView{

    /**
     * 初始化布局Binding
     */
    protected ActivityFeatureBinding binding;

    @Override
    protected FeaturePresenter createPresenter() {
        return new FeaturePresenter(this);
    }

    @Override
    protected void initView() {
        String data1 = ActivityUtil.getIntentData();
        if (data1.equals(GlobalConstant.CIRCULAR_CURVE)){
            binding.button1DeclinationMethod.setOnClickListener(view -> ActivityUtil.actionSecondStart(InputActivity.class,data1,GlobalConstant.DECLINATION_METHOD));
            binding.button2TangentSupportMethod.setOnClickListener(view -> ActivityUtil.actionSecondStart(InputActivity.class,data1,GlobalConstant.TANGENT_SUPPORT_METHOD));
            binding.button3PolarCoordinateMethod.setOnClickListener(view -> ActivityUtil.actionSecondStart(InputActivity.class,data1,GlobalConstant.POLAR_COORDINATE_METHOD));
            binding.button4CoordinateStaking.setOnClickListener(view -> ActivityUtil.actionSecondStart(InputActivity.class,data1,GlobalConstant.COORDINATE_STAKING));
        }else {
            binding.button1DeclinationMethod.setOnClickListener(view -> ActivityUtil.actionSecondStart(InputActivity.class,GlobalConstant.MODERATION_CURVE,GlobalConstant.DECLINATION_METHOD));
            binding.button2TangentSupportMethod.setOnClickListener(view -> ActivityUtil.actionSecondStart(InputActivity.class,GlobalConstant.MODERATION_CURVE,GlobalConstant.TANGENT_SUPPORT_METHOD));
            binding.button3PolarCoordinateMethod.setOnClickListener(view -> ActivityUtil.actionSecondStart(InputActivity.class,GlobalConstant.MODERATION_CURVE,GlobalConstant.POLAR_COORDINATE_METHOD));
            binding.button4CoordinateStaking.setOnClickListener(view -> ActivityUtil.actionSecondStart(InputActivity.class,GlobalConstant.MODERATION_CURVE,GlobalConstant.COORDINATE_STAKING));
        }

    }

    @Override
    protected void initData() {

    }

    @Override
    protected View getRootView() {
        binding = ActivityFeatureBinding.inflate(getLayoutInflater());
        return binding.getRoot();
    }

}